package com.minstone.common.boss.log.service.impl;

import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.minstone.common.boss.log.bean.LogBean;
import com.minstone.common.boss.log.dao.LogDao;
import com.minstone.common.boss.log.service.ILogService;

@Service
public class LogServiceImpl implements ILogService {
	
	@Autowired
	private LogDao logDao;

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void insertLog(LogBean logBean) {
		if(StringUtils.isBlank(logBean.getSeq())){
			logBean.setSeq(UUID.randomUUID().toString());
		}
		this.logDao.insertLog(logBean);
	}

}
